package com.simpleplayer.engine;

import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.TextureView;

import androidx.annotation.IntDef;
import androidx.annotation.NonNull;

import com.google.android.exoplayer2.util.FileTypes;

import java.io.IOException;

public abstract class PlayerEngine {

    @IntDef({ExoPlayer, AndroidMediaPlayer, IjkPlayer})
    public @interface ENGINETYPE {}

    public static final int ExoPlayer = 0;
    public static final int AndroidMediaPlayer = 1;
    public static final int IjkPlayer = 2;

    private PlayerEngineClient mClient = PlayerEngineClient.DEFAULT;

    public void setClient(@NonNull PlayerEngineClient client) {
        mClient = client;
    }
    public PlayerEngineClient getClient() {
        return mClient;
    }

    public long getBandwidth() { return 0L; }

    public void setSurfaceView(SurfaceView surfaceView) {}
    public void setTextureView(TextureView textureView) {}

    public abstract long getCurrentPosition();
    public abstract long getDuration();
    public abstract void prepare(String uri);
    public abstract void play();
    public abstract void pause();
    public abstract void release();
    public abstract void seekTo(long position);
    public abstract void setSurface(Surface surface);
    public abstract void setDisplay(SurfaceHolder holder);
    public abstract int getVideoHeight();
    public abstract int getVideoWidth();
    public abstract void setVolume(float volume);
}
